//
//  IntegralAmountOtherTableViewCell.m
//  GoodWayClient
//
//  Created by HuiDong on 15/12/3.
//  Copyright © 2015年 HuiDong. All rights reserved.
//

#import "IntegralAmountOtherTableViewCell.h"
#import "IntegralAmount.h"

@interface IntegralAmountOtherTableViewCell ()
@property (weak, nonatomic) IBOutlet UILabel *reason;
@property (weak, nonatomic) IBOutlet UILabel *achieve;
@property (weak, nonatomic) IBOutlet UILabel *time;

@end

@implementation IntegralAmountOtherTableViewCell

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

+ (instancetype) IntegralAmountOtherWithTableView:(UITableView *)tableView
{
    static NSString *identifier = @"cell";
    IntegralAmountOtherTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:identifier];
    if (cell == nil) {
        cell = [[[NSBundle mainBundle] loadNibNamed:@"IntegralAmountOtherTableViewCell" owner:nil options:nil] lastObject];
    }
    return cell;
}

- (void)setDic:(NSDictionary *)dic
{
    _dic = dic;
    IntegralAmount *integralAmount = [[IntegralAmount alloc] initWithDic:dic];
    self.reason.text = [NSString stringWithFormat:@"%@",integralAmount.Description];
    self.achieve.text = [NSString stringWithFormat:@"获得了%f元和%d积分",integralAmount.GetMoney,integralAmount.GetScore];
    self.time.text = [NSString stringWithFormat:@"%@",integralAmount.CreateTime];
}

@end
